#ifndef INET_H
#define INET_H

#include "../types/nettypes.h"

#include <coretypes.h>

namespace net
{

class IArc;
class IColorSet;
class IExpression;
class IPlace;
class ITransition;

class INet
{
public:
    virtual void run(int repetitions = 1) = 0;
    virtual void pause() = 0;
    virtual void stop() = 0;
    virtual void stepForward() = 0;
    virtual void stepBackward() = 0;
    virtual void setSimulationSpeed(uint speed) = 0;

    virtual bool isLocked() const = 0;

    virtual IPlace* addPlace(IColorSet* colorSet, QString name = QString(),
        nid id = nid()) = 0;
    virtual ITransition* addTransition(QString name = QString(),
        nid id = nid()) = 0;
    virtual IExpression* addExpression(const Expr& expr,
        const core::TypeName& context, nid id = nid(),
        bool timed = false) = 0;
    virtual void removePlace(IPlace* place) = 0;
    virtual void removeTransition(ITransition* transition) = 0;
    virtual void removeExpression(IExpression* expression) = 0;

    virtual IArc* connect(IPlace* source,
        ITransition* destination) = 0;
    virtual IArc* connect(ITransition* source,
        IPlace* destination) = 0;
    virtual void disconnect(IArc* arc) = 0;
    virtual void disconnectAll(IPlace* place) = 0;
    virtual void disconnectAll(ITransition* transition) = 0;

protected:
    virtual ~INet() {}
};

} // namespace net
#endif
